package com.hrt.manage.product.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.hrt.base.BaseDaoImpl;
import com.hrt.bean.GiftTypeDir;
import com.hrt.manage.product.dao.GiftTypeDirDao;
@Repository
public class GiftTypeDirDaoImpl extends BaseDaoImpl<GiftTypeDir> implements GiftTypeDirDao{
	
	/** 按是否删除查询  */
	@SuppressWarnings("unchecked")
	@Override
	public List<GiftTypeDir> findDelAll() {
		return getHibernateTemplate().find("FROM GiftTypeDir WHERE isDelete=0");
	}

	/**根据礼品分类的ID找到礼品分类目录明细的列表*/
	@SuppressWarnings("unchecked")
	@Override
	public List<GiftTypeDir> queryGiftTypeDirByGdId(Long typeId) {
		return this.getHibernateTemplate().find("FROM GiftTypeDir gitydir WHERE gitydir.isdelete=0 and gitydir.typeId = '"+typeId+"'");
	}
	
	/**根据礼品基本信息的ID找到礼品分类目录明细的列表*/
	@SuppressWarnings("unchecked")
	@Override
	public List<GiftTypeDir> getGiftTypeDirByGIId(Long giftId) {
		return this.getHibernateTemplate().find("FROM GiftTypeDir gitydir WHERE gitydir.isdelete=0 and gitydir.giftId = '"+giftId+"'");
	}
}
